subroutine print_matrix(A)
  integer, parameter :: dbl = 8
  real(dbl), dimension(:,:), intent(in) :: A
  integer :: row, k
  row = size(A,1)
  do k = 1, row
     write(*,*) A(k,:)
  end do
  write(*,*)
end subroutine print_matrix
